import { getGoodTypeList } from '../apis/goodType'

import qs from 'querystring'
export default {
    state: {
        TypeList:[]
    },
    effects: {
        // 获取商品分类：
        *getGoodTypeBySaga({ payload }, { put, call }) {
            const res = yield call(getGoodTypeList,qs.stringify(payload))
            console.log("商品分类型",res);
            yield put({ type: "getGoodTypeList", payload: res.rows.children })
        },
    },
    reducers: {
        getGoodTypeList(state, action) {
            state.TypeList = action.payload
        },
    }
}